package object;

import java.util.Comparator;
import java.util.PriorityQueue;
class Student{
    public int ID;
    public String name;
    public int score;

    public Student(int ID, String name, int score) {
        this.ID = ID;
        this.name = name;
        this.score = score;
    }

    @Override
    public String toString() {
        return "Student{" +
                "ID=" + ID +
                ", name='" + name + '\'' +
                ", score=" + score +
                '}';
    }
}

public class Test_2 {

    public static void main(String[] args) {
        PriorityQueue<Student> pq = new PriorityQueue<>(new Comparator<Student>() {
            @Override
            public int compare(Student o1, Student o2) {
                return o2.score - o1.score;
            }
        });
        pq.offer(new Student(1,"zhungsan",60));
        pq.offer(new Student(1,"zhung",99));
        pq.offer(new Student(1,"zh",79));
        System.out.println(pq);


    }
}
